Address vs Pointers in C
Created: 2022-06-29 Tags: #permanent
Why is it used?
void swap(int *c, int *d) { int *temp = c; *c = *d; *d = *temp; } int main() { swap(&a, &b); // Remember that `&` is getting the address } Copy
void swap(int *c, int *d) { int *temp = c; *c = *d; *d = *temp; } int main() { swap(&a, &b); // Remember that `&` is getting the address }